﻿@model PotentialRentals.Models.RentalListViewModel

<table cellpadding="5" cellspacing="0" border="0" width="100%">
    <tr>
        <td>
            @Html.EditorFor(model => model.Filter.CityState)&nbsp;<span>City/State</span>
        </td>
        <td>
            @Html.TextBoxFor(model => model.Filter.City, new { style = "width: 135px" })
            @Html.ValidationMessageFor(model => model.Filter.City)
        </td>
        <td>
            @Html.DropDownListFor(model => model.Filter.StateId, ViewBag.States as SelectList)
            @Html.ValidationMessageFor(model => model.Filter.StateId)
        </td>
    </tr>

    <tr>
        <td>
            @Html.EditorFor(model => model.Filter.Rent)&nbsp;<span>Rent</span>
        </td>
        <td>
            Min:&nbsp;@Html.TextBoxFor(model => model.Filter.RentRange.Low, new { style = "width: 50px" })
            @Html.ValidationMessageFor(model => model.Filter.RentRange.Low)
        </td>
        <td>
            Max:&nbsp;@Html.TextBoxFor(model => model.Filter.RentRange.High, new { style = "width: 50px" })
            @Html.ValidationMessageFor(model => model.Filter.RentRange.High)
        </td>
    </tr>

    <tr>
        <td>
            @Html.EditorFor(model => model.Filter.Bedrooms)&nbsp;<span>Bedrooms</span>
        </td>
        <td>
            Min:&nbsp;@Html.DropDownListFor(model => model.Filter.BedroomRange.Low, ViewBag.Bedrooms as SelectList)
            @Html.ValidationMessageFor(model => model.Filter.BedroomRange.Low)
        </td>
        <td>
            Max:&nbsp;@Html.DropDownListFor(model => model.Filter.BedroomRange.High, ViewBag.Bedrooms as SelectList)
            @Html.ValidationMessageFor(model => model.Filter.BedroomRange.High)
        </td>
    </tr>

    <tr>
        <td>
            @Html.EditorFor(model => model.Filter.Bathrooms)&nbsp;<span>Bathrooms</span>
        </td>
        <td>
            Min:&nbsp;@Html.DropDownListFor(model => model.Filter.BathroomRange.Low, ViewBag.Bathrooms as SelectList)
            @Html.ValidationMessageFor(model => model.Filter.BathroomRange.Low)
        </td>
        <td>
            Max:&nbsp;@Html.DropDownListFor(model => model.Filter.BathroomRange.High, ViewBag.Bathrooms as SelectList)
            @Html.ValidationMessageFor(model => model.Filter.BathroomRange.High)
        </td>
    </tr>
    <tr>
        <td>
            @Html.EditorFor(model => model.Filter.Type)&nbsp;<span>Type</span>
        </td>
        <td colspan="2">
            @Html.DropDownListFor(model => model.Filter.RentTypeId, ViewBag.RentalTypes as SelectList)
        </td>
    </tr>
    <tr>
        <td colspan="3">
            <input type="submit" value="Filter" />
        </td>
    </tr>
</table>